package s2elinshu;

public class J12SungJuk {

	public static void main(String[] args) {
		J12ExSungJuk taehee = new J12ExSungJuk();
		J12ExSungJuk sooji = new J12ExSungJuk();
		J12ExSungJuk jihyun = new J12ExSungJuk();
		taehee.name = "태희";
		taehee.kor = 99;
		taehee.eng = 89;
		taehee.mat = 79;

		System.out.println(taehee.name);
		System.out.println(taehee.getTotal());
		System.out.println(taehee.getAverage());
		System.out.println(taehee.getGrd());
		
		
		//--------------------------------------------------------------------
		sooji .name = "수지";
		sooji .kor = 70;
		sooji .eng = 90;
		sooji .mat = 80;

		System.out.println(sooji .name);
		System.out.println(sooji .getTotal());
		System.out.println(sooji .getAverage());
		System.out.println(sooji .getGrd());
		
		
		//--------------------------------------------------------------------
		jihyun  .name = "지현";
		jihyun  .kor = 100;
		jihyun  .eng = 90;
		jihyun  .mat = 95;

		System.out.println(jihyun.name);
		System.out.println(jihyun.getTotal());
		System.out.println(jihyun.getAverage());
		System.out.println(jihyun.getGrd());
		

	} // main 닫음
} // J12SungJuk class 닫음

class J12ExSungJuk {
	String name;
	String grd;
	int kor;
	int eng;
	int mat;
	int tot;
	double avg;

	public int getTotal() {
		return kor + eng + mat;
	}

	public double getAverage(){
		return  (double)getTotal()/3;
   }

	public String getGrd() {
		switch ((int) getAverage() / 10) {
		case 10:
		case 9:
			grd = "수";
			break;
		case 8:
			grd = "우";
			break;
		case 7:
			grd = "미";
			break;
		case 6:
			grd = "양";
			break;
		default:
			grd = "가";
		}
		return grd;
	}

} // J12ExSungJuk class 닫음